﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/MasterPage.master" AutoEventWireup="true"
    CodeFile="Direction.aspx.cs" Inherits="Patient_Direction" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder" runat="Server">
    <%--  <script language="javascript" type="text/javascript">
		<!--
		function PrintDirection() 
		{
		    window.open('/PrintPages/PrintDirection.aspx?PatientID=<%=ddlPatients.SelectedValue %>&DoctorID=<%=ddlDoctors.SelectedValue %>&DirectionNumber=<%=txtNumber.Text %>', 'PrintDirection');
		    return false
		}
 	 -->
    </script>--%>
    <table>
        <tr>
            <td colspan="6">
                <br />
            </td>
        </tr>
        <tr>
            <td colspan="6">
                <strong><span style="font-size: 14pt">
                    <br />
                    НАПРАВЛЕНИЕ </span></strong>
                <br />
                <br />
            </td>
        </tr>
        <tr>
            <td colspan="6">
                <br />
            </td>
        </tr>
        <tr>
            <td colspan="2">
                Пациент:
                <asp:DropDownList ID="ddlPatients" runat="server" AutoPostBack="true" DataSourceID="sdsPatient"
                    DataTextField="PatientName" DataValueField="PatientID">
                </asp:DropDownList>
            </td>
            <td colspan="2">
                Преглед №
                <asp:TextBox ID="txtNumber" runat="server"></asp:TextBox>
            </td>
            <td colspan="2">
                Изпратен от лекар:
                <asp:DropDownList ID="ddlDoctors" runat="server" DataSourceID="sdsDoctors" DataTextField="DoctorName"
                    DataValueField="DoctorID">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td colspan="6">
                <br />
            </td>
        </tr>
        <tr>
            <td colspan="6" align="right">
                <asp:Button ID="btnPrint" runat="server" Text="Отпечатай" OnClick="btnPrint_Click" />
            </td>
        </tr>
    </table>
    <asp:SqlDataSource ID="sdsPatient" runat="server" ConnectionString="<%$ ConnectionStrings:ClinicConnectionString %>"
        SelectCommand="up_PatientsGetNames" SelectCommandType="StoredProcedure" UpdateCommand="up_AttendantsDelete"
        UpdateCommandType="StoredProcedure">
        <UpdateParameters>
            <asp:Parameter Name="AttendantID" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="sdsPatients" runat="server" ConnectionString="<%$ ConnectionStrings:ClinicConnectionString %>"
        DeleteCommand="up_PatientsDelete" DeleteCommandType="StoredProcedure" InsertCommand="up_PatientsCreate"
        InsertCommandType="StoredProcedure" SelectCommand="up_PatientsGetByID" SelectCommandType="StoredProcedure"
        UpdateCommand="up_PatientsUpdate" UpdateCommandType="StoredProcedure">
        <SelectParameters>
            <asp:ControlParameter ControlID="ddlPatients" Name="PatientID" PropertyName="SelectedValue"
                Type="Int32" />
        </SelectParameters>
        <DeleteParameters>
            <asp:Parameter Name="patientID" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="patientID" Type="Int32" />
            <asp:Parameter Name="name" Type="String" />
            <asp:Parameter Name="middleName" Type="String" />
            <asp:Parameter Name="lastName" Type="String" />
            <asp:Parameter Name="egn" Type="String" />
            <asp:Parameter Name="age" Type="Int16" />
            <asp:Parameter Name="city" Type="String" />
            <asp:Parameter Name="currentJob" Type="String" />
            <asp:Parameter Name="jobCity" Type="String" />
            <asp:Parameter Name="educationID" Type="Int16" />
            <asp:Parameter Name="profession" Type="String" />
            <asp:Parameter Name="iDCardType" Type="Int16" />
            <asp:Parameter Name="iDCardNum" Type="String" />
            <asp:Parameter Name="iDCardIssuedBy" Type="String" />
            <asp:Parameter Name="iDCardIssueDate" Type="DateTime" />
            <asp:Parameter Name="iSWasIllByHepatit" Type="Boolean" />
            <asp:Parameter Name="infectiousFriends" Type="Boolean" />
            <asp:Parameter Name="dateOfSignUp" Type="DateTime" />
            <asp:Parameter Name="companyID" Type="Int32" />
            <asp:Parameter Name="isSendByCompany" Type="Boolean" />
            <asp:Parameter Name="Telephone" Type="String" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="name" Type="String" />
            <asp:Parameter Name="middleName" Type="String" />
            <asp:Parameter Name="lastName" Type="String" />
            <asp:Parameter Name="egn" Type="String" />
            <asp:Parameter Name="age" Type="Int16" />
            <asp:Parameter Name="city" Type="String" />
            <asp:Parameter Name="currentJob" Type="String" />
            <asp:Parameter Name="jobCity" Type="String" />
            <asp:Parameter Name="educationID" Type="Int16" />
            <asp:Parameter Name="profession" Type="String" />
            <asp:Parameter Name="iDCardType" Type="Int16" />
            <asp:Parameter Name="iDCardNum" Type="String" />
            <asp:Parameter Name="iDCardIssuedBy" Type="String" />
            <asp:Parameter Name="iDCardIssueDate" Type="DateTime" />
            <asp:Parameter Name="iSWasIllByHepatit" Type="Boolean" />
            <asp:Parameter Name="infectiousFriends" Type="Boolean" />
            <asp:Parameter Name="dateOfSignUp" Type="DateTime" />
            <asp:Parameter Name="companyID" Type="Int32" />
            <asp:Parameter Name="isSendByCompany" Type="Boolean" />
            <asp:Parameter Name="Telephone" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="sdsDoctors" runat="server" ConnectionString="<%$ ConnectionStrings:ClinicConnectionString %>"
        SelectCommand="up_DoctorsGetNames" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
    <asp:SqlDataSource ID="sdsDirection" runat="server" ConnectionString="<%$ ConnectionStrings:ClinicConnectionString %>"
        DeleteCommand="up_DirectionDelete" DeleteCommandType="StoredProcedure" InsertCommand="up_DirectionInsert"
        InsertCommandType="StoredProcedure" SelectCommand="up_DirectionSelect" SelectCommandType="StoredProcedure"
        UpdateCommand="up_DirectionUpdate" UpdateCommandType="StoredProcedure">
        <DeleteParameters>
            <asp:Parameter Name="DirectionID" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="DirectionID" Type="Int32" />
            <asp:Parameter Name="PatientID" Type="Int32" />
            <asp:Parameter Name="DoctorID" Type="Int32" />
            <asp:Parameter Name="DirectionNumber" Type="String" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="DirectionID" Type="Int32" />
            <asp:ControlParameter Name="PatientID" Type="Int32" ControlID="ddlPatients" />
            <asp:ControlParameter Name="DoctorID" Type="Int32" ControlID="ddlDoctors" />
            <asp:ControlParameter Name="DirectionNumber" Type="String" ControlID="txtNumber" />
        </InsertParameters>
    </asp:SqlDataSource>
</asp:Content>
